<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>CRUD de Marcas</title>
</head>
<body>
	<h3>Marcas :</h3>

	<!-- Imagenes de los hipervinculos -->
	<c:url var="editImgUrl" value="view/resources/images/edit.png" />
        <c:url var="deleteImgUrl" value="view/resources/images/delete.png" />

	<c:if test="${fn:length(Marcas) > 0}">

		<table style="border: 1px solid; width: 100%; text-align: center">
			<thead style="background: #d3dce3">
				<tr>
					<th>Id</th>
					<th>Nombre</th>
					<th colspan="2"></th>
				</tr>
			</thead>

			<tbody style="background: #ccc">

				<c:forEach items="${Marcas}" var="marca">

					<tr>
						<td><c:out value="${marca.idmarca}" /></td>
						<td><c:out value="${marca.nombre}" /></td>
						<td><a href="javascript:editarMarcaGet(${marca.idmarca});"><img
								src="${editImgUrl}"></img> </a></td>
						<td><a href="javascript:showAsk('Desea borrar?',${marca.idmarca},4);"><img
								src="${deleteImgUrl}"></img> </a></td>

					</tr>

				</c:forEach>

			</tbody>
		</table>
		<p>
			<a href="javascript:addMarca();">Crear Nueva Marca</a>
		</p>

	</c:if>

	<c:if test="${empty Marcas}">
	No se encontraron registros de marcas, <p>
			<a href="javascript:addMarca();">Crear Nueva Marca</a>
		</p>
	</c:if>
	<br />

</body>
</html>